/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.retail;

import com.opensymphony.xwork2.ActionSupport;
import database.TOrderDAO;
import model.Order;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author Thai Ha Cong
 */
@Namespace("/Member")
public class ViewOrderDetailsAction extends ActionSupport {
    
    private Integer idOrder;
    private Order order;
    
    public ViewOrderDetailsAction() {
    }

    public Integer getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(Integer idOrder) {
        this.idOrder = idOrder;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }
    
    @Override
    @Action(value = "viewOrderDetails", results = {
        @Result(name = "success", location = "/member/viewOrderDetails.jsp")
    })
    public String execute() throws Exception {
        TOrderDAO tOrderDAO = new TOrderDAO();
        order = tOrderDAO.getOrderDetails(idOrder);
        
        return SUCCESS;
    }
}